/*This file is part of AENIMA. AENIMA is a module of BCI++ framework for the implementation of brain computerinterface systems. 
AEnima is intended for use with BCI++ only.

BCI++ is a project of the Sensibilab of the Politecnico di Milano. 

AENIMA is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation, either version 3 of 
the License, or (at your option) any later version.

AENIMA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
and the GNU Lesser General Public License along with AENIMA.  
If not, see <http://www.gnu.org/licenses/>.*/

/*!
	\file	LedDriver_base.h
	 This file contains LedDriver_base class. This class allow to create dynamic library and exchange data with
	 the main program.

	\author	Sensibilab EMail: info.sensibilab@polimi.it

	\date	2007-09-06 creation \n
		2009-01-27 last modification

	\b COPYRIGHT: 
		This program is property of Sensibilab - Campus Ponit - Lecco
*/

#pragma once
#include "wx/ctb/serport.h"
#include <iostream>

using namespace std;

#define		BASE_COMMAND_VALUE	0xAAAAAAAA

#define		SET_PERIODS		(BASE_COMMAND_VALUE+1)
#define		LEDS_ON			(BASE_COMMAND_VALUE+2)
#define		LEDS_OFF		(BASE_COMMAND_VALUE+3)

#pragma once
typedef struct LED_Command
{
	unsigned int		command;
	unsigned short int	Data[4];
}LED_Command;

/*!\class LedDriver_base
Class for the stimuli management. View LedDriver_base documentation in AEnima doc for more details.*/
class LedDriver_base
{
public:
	LedDriver_base();
	virtual ~LedDriver_base();
	virtual void Close();
	virtual int Stop();
	virtual int Start();
	virtual int SetPeriods(int *pPeriods,char num);
	virtual int Init(char *pPortName);
	wxSerialPort *pDev;
	bool isOn;
};